cc.Class({
    extends: cc.Component,

    properties: {
        l_buttletNum: cc.Label,
        l_buttletAllNum: cc.Label,

        r_buttletNum: cc.Label,
        r_buttletAllNum: cc.Label,

        l_name: cc.Label,
        r_name: cc.Label,

        l_bloodNum: cc.Label,
        l_bloodAllNum: cc.Label,

        r_bloodNum: cc.Label,
        r_bloodAllNum: cc.Label,

        l_fen: cc.Label,
        r_fen: cc.Label,

        l_win: {
            default: [],
            type: cc.Sprite
        },
        r_win: {
            default: [],
            type: cc.Sprite
        },
        l_jindutiao: cc.Node,
        r_jindutiao: cc.Node,

    },

    // LIFE-CYCLE CALLBACKS:

    onLoad() {
        this.l_win_num = 0;
        this.r_win_num = 0;
        this.init();
    },
    init() {
        this.l_fen.string = this.l_win_num + "";
        this.r_fen.string = this.r_win_num + "";

        this.l_bloodNum.string = this.r_win_num + "";
        this.l_bloodAllNum.string = this.r_win_num + "";

        this.r_bloodNum.string = this.r_win_num + "";
        this.r_bloodAllNum.string = this.r_win_num + "";

        for (var a = 0; a < this.l_win.length; a++) {
            this.l_win[a].node.getChildByName("win").active = false;
        }
        for (var a = 0; a < this.r_win.length; a++) {
            this.r_win[a].node.getChildByName("win").active = false;
        }
    },
    /**
     * 更改胜利局数
     * @param type   type： left左边胜利一句，type： right右边胜利一句，
     */
    restwin(type) {
        if (type == "left") {
            this.l_win[this.l_win_num].node.getChildByName("win").active = true;
            this.l_win_num++;

        } else {
            this.r_win[this.r_win_num].node.getChildByName("win").active = true;
            this.r_win_num++;
        }
    },
    start() {

    },

    // update (dt) {},
});
